package com.lizy

import org.junit.Test

class CollectionTest {

    /**
     * 习题1
     */
    @Test
    public void test1() {
        def list = [14,12,13,11];
        println('list.reverse() : ' + list.reverse())
    }

    /**
     * 习题2
     */
    @Test
    public void test2() {
        def list = [1,[2,[3,4]]];
        println('list.flatten() : ' + list.flatten())
    }

    /**
     * 习题3
     */
    @Test
    public void test3() {
        def list1 = [11,12,13,14];
        def list2 = [13,14,15];

        println('(list1-list2) : ' + (list1-list2));
        println('(list1+list2) : ' + (list1+list2));
        println('(list2-list1) : ' + (list2-list1));
    }

    @Test
    public void test4() {
        def names = ['Ken' : 'Barclay', 'Jonn':'Savage', 'Ken':'Chisholm'];
        println('names.Ken : ' + names.Ken);
    }


}
